package com.aspose.cells;

public class Marker {
   private Line b;
   private Area c;
   private int d = 0;
   private int e = 5;
   boolean a = true;
   private Object f;
   private zor g;
   private Chart h;
   private ShapePropertyCollection i;

   void a() {
      this.g.a((Object)null);
   }

   public Line getBorder() {
      if (this.b == null) {
         this.b = new Line(this.g.r(), this);
      }

      return this.b;
   }

   public Area getArea() {
      if (this.c == null) {
         this.c = new Area(this.g.r(), this);
      }

      return this.c;
   }

   public int getMarkerStyle() {
      return this.d;
   }

   public void setMarkerStyle(int value) {
      this.d = value;
      this.a();
      if (value == 5) {
         this.getBorder().n(2);
         this.getArea().setFormatting(1);
      } else if (value == 0) {
         this.getBorder().n(0);
         this.getArea().setFormatting(0);
      }

   }

   void a(int var1) {
      this.d = var1;
   }

   public int getMarkerSize() {
      return this.e;
   }

   public void setMarkerSize(int value) {
      if (value >= 2 && value <= 72) {
         this.e = value;
         this.a();
         this.j();
         this.a = false;
      } else {
         throw new IllegalArgumentException("Invalid marker size : it must be between 2 and 27.");
      }
   }

   public int getMarkerSizePx() {
      int var1 = 96;
      if (this.h != null) {
         var1 = this.h.j().L();
      }

      return (int)((float)(this.e * var1) / 72.0F + 0.5F);
   }

   public void setMarkerSizePx(int value) {
      int var2 = 96;
      if (this.h != null) {
         var2 = this.h.j().L();
      }

      this.setMarkerSize((int)((float)value * 72.0F / (float)var2 + 0.5F));
   }

   Area b() {
      return this.c;
   }

   Line c() {
      return this.b;
   }

   Marker(Object parent, zor dataFormat) {
      this.f = parent;
      this.g = dataFormat;
      this.h = dataFormat.r();
      if (this.h != null) {
         if (this.h.j().n().j()) {
            this.e = 7;
         } else {
            this.e = 5;
         }
      }

   }

   void b(int var1) {
      switch(var1) {
      case 37:
      case 38:
      case 39:
      case 57:
      case 62:
      case 64:
         this.setMarkerStyle(5);
         this.a();
      default:
      }
   }

   void a(Marker var1, CopyOptions var2) {
      this.d = var1.d;
      this.setMarkerSize(var1.getMarkerSize());
      if (var1.b != null) {
         this.b = new Line(this.g.r(), this);
         this.b.a(var1.b);
      }

      if (var1.c != null) {
         this.c = new Area(this.g.r(), this);
         this.c.a(var1.c, var2);
      }

      if (var1.i != null) {
         this.i = new ShapePropertyCollection(this.g.r(), this, 4);
         this.i.a(var1.i, var2);
      }

   }

   Color d() {
      return this.getBorder().getColor();
   }

   void a(Color var1) {
      this.getBorder().a(var1);
      this.getBorder().n(1);
      this.a();
      this.j();
   }

   int e() {
      if (this.b != null) {
         switch(this.b.getFormattingType()) {
         case 0:
            return 0;
         case 1:
            return this.b.b.a() ? 0 : 2;
         case 2:
            return 1;
         }
      }

      return 0;
   }

   void c(int var1) {
      switch(var1) {
      case 0:
         this.getBorder().n(0);
         this.getBorder().b.a(true);
         break;
      case 1:
         this.getBorder().n(2);
         break;
      default:
         this.getBorder().n(1);
      }

      this.a();
      this.j();
   }

   Color f() {
      return this.getArea().getForegroundColor();
   }

   void b(Color var1) {
      this.getArea().setForegroundColor(var1);
      this.getArea().setFormatting(2);
      this.a();
      this.j();
   }

   int g() {
      return this.getArea().getFormatting();
   }

   void d(int var1) {
      this.getArea().setFormatting(var1);
      this.a();
      this.j();
   }

   Chart h() {
      return this.h;
   }

   private void j() {
      if (this.d == 0) {
         int var1 = 0;
         if (this.f != null && this.f instanceof Series) {
            var1 = ((Series)this.f).B();
         }

         var1 %= 9;
         var1 += 2;
         switch(var1) {
         case 2:
            this.d = 3;
            break;
         case 3:
            this.d = 7;
            break;
         case 4:
            this.d = 9;
            break;
         case 5:
            this.d = 10;
            break;
         case 6:
            this.d = 8;
            break;
         case 7:
            this.d = 1;
            break;
         case 8:
            this.d = 6;
            break;
         case 9:
            this.d = 4;
            break;
         case 10:
            this.d = 2;
            break;
         default:
            this.d = 5;
         }

      }
   }

   ShapePropertyCollection i() {
      if (this.i == null) {
         this.i = new ShapePropertyCollection(this.g.r(), this, 4);
      }

      return this.i;
   }
}
